var mask = null;

var login_user = null
var knockdownRecord_id = null

$(function() { // 初始化内容
	mui.plusReady();
	mui.init();
	tap_init();
	mask = mui.createMask(); //遮罩层

	login_user = JSON.parse(localStorage.getItem('loginUser'));
	datetime_init();
	knockdownRecord_id = sessionStorage.getItem('knockdownRecord_id')

	window.setTimeout(function() {
		loadknockdownRecord()

	}, 500);



})


function tap_init() {

	jQuery(document).ready(function() {

		jQuery("#onechannelid").change(function() {
			var onechannelid = jQuery("#onechannelid").val()

			gettowChannel(onechannelid, "")
		});

	});


}



function loadknockdownRecord() {
	var data = {};
	data['id'] = knockdownRecord_id
	console.log("获取成交记录信息=====" + JSON.stringify(data));
	jQuery.ajax({
		type: "post",
		headers: {
			'Authorization': login_user.token
		},
		url: serverip + "fxgw/loadsksq",
		contentType: 'application/json;charset=UTF-8',
		data: JSON.stringify(data),
		dataType: "json",
		timeout: 10000,
		beforeSend: function() {

			mask.show(); //显示遮罩层	
		},
		success: function(res) {
			mask.close(); //显示遮罩层 	  
			console.log("成交记录信息=====" + JSON.stringify(res));	
			
		
			loadForm(res.newxlc_closing_record[0])
			var newxlc_closing_record = res.newxlc_closing_record[0]
			if(newxlc_closing_record.isshare == "" ){
				jQuery("#isshare").val("否")
			}
			jQuery("#channelname").val(newxlc_closing_record.onechannelname + "--"+newxlc_closing_record.twochannelname)
		

		},
		error: function(e) {
			console.log("错误信息====" + JSON.stringify(e));
			mask.close(); //显示遮罩层
			var msg = e.responseJSON.message;
			var code = e.responseJSON.status;
			mui.alert('错误编码' + code + "\n" + "错误信息:" + msg);
			console.log("错误信息====" + JSON.stringify(e));
		}
	});


}

